#ifndef OperatorQueue_h
#define OperatorQueue_h

#include <CryExtension/Impl/ClassWeaver.h>
#include "ICryAnimation.h"

namespace AnimPoseModifier {

class COperatorQueue :
	public IAnimationPoseModifier
{
public:
	CRYINTERFACE_BEGIN()
		CRYINTERFACE_ADD(IAnimationPoseModifier)
	CRYINTERFACE_END()

	CRYGENERATE_CLASS(COperatorQueue, "AnimationPoseModifier_OperatorQueue", 0xac90f2bc76a843ec, 0x9970463fb080a520);

public:
	enum ETarget
	{
		eTarget_Position,
		eTarget_Orientation,
	};

	enum EOp
	{
		eOp_Override,
		eOp_Additive,
	};

private:
	struct SOp
	{
		uint32 joint;
		uint16 target;
		uint16 op;
		f32 value[4];
	};

public:
	virtual void PushPosition(uint32 jointIndex, EOp eOp, const Vec3& value);
	virtual void PushOrientation(uint32 jointIndex, EOp eOp, const Quat& value);

	// IAnimationPoseModifier
public:
	virtual bool Prepare(const SAnimationPoseModiferParams& params);
	virtual bool Execute(const SAnimationPoseModiferParams& params);
	virtual void Synchronize();

	void GetMemoryUsage(ICrySizer* pSizer) const
	{
		pSizer->AddObject(this, sizeof(*this));
	}

private:
	std::vector<SOp> m_ops[2];
	uint32 m_current;
} _ALIGN(32);

} // namespace AnimPoseModifier

#endif // OperatorQueue_h
